////
////  AudioEncoder.swift
////  VideoPhotoCapture
////
////  Created by 杨伟诺 on 2020/10/26.
////
//
//import UIKit
//import AVFoundation
//
//@objc protocol AudioEncoderDelegate{
//    
//    func audioEncodeCallback(aacData: Data)
//}
//
//class AudioEncoder: NSObject {
//
//    private var encoderQueue: DispatchQueue = DispatchQueue.init(label: "encoderQueue")
//    private var callbackQueue: DispatchQueue = DispatchQueue.init(label: "callbackQueue")
//    var config: AudioConfig!
//    private var audioConverter: AudioConverterRef!
//    private var pcmBuffer: CChar?
//    private var pcmBufferSize: size_t = 0
//    
//    weak var delegate: AudioEncoderDelegate?
//    
//    func encodeAudioSamepleBuffer(sampleBuffer: CMSampleBuffer){
//        
//        
//    }
//    
//    func setupEncoderWithSampleBuffer(sampleBuffer: CMSampleBuffer){
//        
//        let inputDes = CMAudioFormatDescriptionGetStreamBasicDescription(CMSampleBufferGetFormatDescription(sampleBuffer)!)
//        
//        var outputDes: AudioStreamBasicDescription = AudioStreamBasicDescription.init()
//        
//        outputDes.mSampleRate = Float64(config.sampleRate)
//        outputDes.mFormatID = kAudioFormatMPEG4AAC
//        outputDes.mFormatFlags = kAudioFormatMPEG4AAC
//        outputDes.mBytesPerPacket = 0
//        outputDes.mFramesPerPacket = 1024
//        outputDes.mBytesPerFrame = 0
//        outputDes.mChannelsPerFrame = UInt32(config.channelCount)
//        outputDes.mBitsPerChannel = 0
//        outputDes.mReserved = 0
//        
//        var outDesSize: Int32 = Int32(MemoryLayout.size(ofValue: outputDes))
//        var p: UnsafeMutablePointer<Int32>?
////        p.initialize(to: outDesSize)
////        AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, nil, unsafeBitCast(outDesSize, to: UnsafeMutablePointer<Int32>?.self), &outputDes)
//        
//        
//        
//        
//        
//        
//        AudioFormatGetProperty(<#T##inPropertyID: AudioFormatPropertyID##AudioFormatPropertyID#>, <#T##inSpecifierSize: UInt32##UInt32#>, <#T##inSpecifier: UnsafeRawPointer?##UnsafeRawPointer?#>, <#T##ioPropertyDataSize: UnsafeMutablePointer<UInt32>?##UnsafeMutablePointer<UInt32>?#>, <#T##outPropertyData: UnsafeMutableRawPointer?##UnsafeMutableRawPointer?#>)
//        AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, nil, p, &outputDes)
//    }
//}
